//
//  HMCheapTicketTableViewCell.m
//  HMMarket
//
//  Created by haohao on 2017/6/15.
//  Copyright © 2017年 homai. All rights reserved.
//

#import "HMCheapTicketTableViewCell.h"
#import "CouponModel.h"

@interface HMCheapTicketTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *RangeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *IconImage;
@property (weak, nonatomic) IBOutlet UILabel *TimeLabel;
@property (weak, nonatomic) IBOutlet UILabel *DescLabel;
@property (weak, nonatomic) IBOutlet UILabel *TypeLabel;
@property (weak, nonatomic) IBOutlet UILabel *OutTimeLabel;

@end

@implementation HMCheapTicketTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = kBackGolor;
    // Initialization code
}

- (void)setDetail:(CouponDetail *)detail
{
    _detail = detail;
    NSLog(@"%@",_detail.status);
    
    if ([_detail.status isEqualToString:@"0"]) {
        self.IconImage.image = [UIImage imageNamed:@"ticket_bg4"];
        self.OutTimeLabel.hidden = YES;
    } else if ([_detail.status isEqualToString:@"2"]) {
        self.IconImage.image = [UIImage imageNamed:@"ticket_bg3"];
        self.OutTimeLabel.hidden = NO;
    }
    
    self.priceLabel.text = _detail.price;
    self.RangeLabel.text = _detail.range;
    self.TypeLabel.text = _detail.type;
    self.DescLabel.text = _detail.desc;
    self.TimeLabel.text = [NSString stringWithFormat:@"有效期：%@-%@",_detail.start_time,_detail.end_time];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
